<template>
    <view class='page'>
        <u-navbar class="gradient-bg" title="我的账户" navbarType="2" fontColor="#ffffff" gradient="linear-gradient(to bottom right, #2e996f, #3f99ab)"
            @leftClick='leftClick'></u-navbar>
        <view class="my-top">
            <!-- 用户信息 -->
            <view class="user-info">
                <view class="info">
                    <view class="money">
                        <text><text class="y">￥</text>{{data.user.remain_amount}}</text>
                    </view>
                    <view class="text">
                        <text>积分余额</text>
                    </view>
                </view>
            </view>
        </view>
        <view class="box1">
            <view class="boxli">
                <view class="item" @click="$toPage('/pagesB/withdrawal/bankCard')">
                    <image :src="$imgUrl+'withdrawal/card.png'" mode="heightFix" />
                    <text>银行卡</text>
                </view>
                <view class="item" @click="$toPage('/pagesB/withdrawal/fund')">
                    <image :src="$imgUrl+'withdrawal/mx.png'" mode="heightFix" />
                    <text>资金明细</text>
                </view>
            </view>
        </view>
        <view class="box2 box">
            <text>
                提现规则：
            </text>
            <u-parse :content="data.data.rule_desc"></u-parse>
        </view>
        <view class="addBtn">
            <!-- @click="goPage()" -->
            <button type="default" @click="toCash()">去提现</button>
        </view>
        <u-modal :show="show" title="提示" content="该功能尚未开放，请耐心等待" @confirm="show=false" :asyncClose="true"></u-modal>
    </view>
</template>
<script>
import { getWithList } from "@/api/withdrawal.js"
export default {
    components: {},
    data() {
        return {
            $imgUrl: this.$imgUrl,
            data: {},
            show: false
        };
    },
    onLoad(options) {
        this.getList()
    },
    methods: {
        getList() {
            getWithList().then(res => {
                console.log(res, "resss")
                this.data = res.data
                console.log(this.data, "indexData")
                // card handling/100 手续费
                // is_open: 0 提现未开启，1开启
            })
        },
        leftClick() {
            uni.switchTab({
                url: "/pages/mine/index"
            })
        },
        toCash() {
            if (this.data.data.is_open == 1) {
                uni.navigateTo({
                    url: '/pagesB/withdrawal/withdrawal'
                })
            } else {
                this.show = true
            }
        }
    },
};
</script>
<style scoped lang='scss'>
.page {
  width: 100%;
  background-color: #f6f6f6;
  .my-top {
    width: 100%;
    height: 260rpx;
    background: linear-gradient(to bottom, #2e996e, #3f99ab);
    overflow: hidden;
    /* 用户信息 */
    .user-info {
      padding: 0 5%;
      height: 100%;
      .info {
        height: 100%;
        display: flex;
        align-items: center;
        // justify-content: center;
        justify-content: flex-end;
        flex-direction: column;
        text {
          color: #ffffff;
        }
        .money {
          text {
            font-size: 60rpx;
          }
          .y {
            font-size: 39rpx;
          }
        }
        .text {
          padding: 44rpx 0;
          text {
            font-size: 28rpx;
          }
        }
      }
    }
  }
  .box1 {
    width: 100%;
    height: 134rpx;
    background-color: #ffffff;
    .boxli {
      width: 55%;
      margin: 0 auto;
      height: 100%;
      display: flex;
      justify-content: space-between;
      align-items: center;
      .item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        image {
          height: 50rpx;
          margin-bottom: 10rpx;
        }
        text {
          font-size: 24rpx;
          color: #52514e;
        }
      }
    }
  }
  .box2 {
    padding: 20rpx 0;
    text {
      font-size: 24rpx;
      color: #52514e;
    }
    /deep/text {
      font-size: 24rpx;
      color: #52514e;
      line-height: 30rpx;
    }
  }
  .addBtn {
    width: 100%;
    margin-top: 30rpx;
    button {
      width: 650rpx;
      height: 90rpx;
      background-color: $base;
      border-radius: 6rpx;
      color: #ffffff;
      font-size: 32rpx;
      line-height: 90rpx;
    }
  }
}
</style>